/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package control_escolar;

import static control_escolar.inicio.constancia_inicio;
import static control_escolar.log.claves_sesion2;
import static control_escolar.log.expedientes;
import java.awt.Image;
import java.awt.Toolkit;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import javax.swing.JOptionPane;

/**
 *
 * @author luis carlos piri
 */
public class desarrolladores extends javax.swing.JFrame {

    /**
     * Creates new form desarrolladores
     */
    public desarrolladores() {
        initComponents();
        setLocationRelativeTo(null);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    public Image getIconImage() {
        Image retValue = Toolkit.getDefaultToolkit().getImage(ClassLoader.getSystemResource("umbrella-corp-2-icon.png"));
        return retValue;
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jButton8 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jButton9 = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Equipo de Desarrolladores");
        setIconImage(getIconImage());
        setResizable(false);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/alex.jpg"))); // NOI18N
        jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButton1MousePressed(evt);
            }
        });
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/damaris.jpg"))); // NOI18N
        jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButton2MousePressed(evt);
            }
        });

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/danny.jpg"))); // NOI18N
        jButton3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButton3MousePressed(evt);
            }
        });

        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fabby.jpg"))); // NOI18N
        jButton4.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButton4MousePressed(evt);
            }
        });

        jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/pancho.jpg"))); // NOI18N
        jButton5.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButton5MousePressed(evt);
            }
        });

        jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/isaac.jpg"))); // NOI18N
        jButton6.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButton6MousePressed(evt);
            }
        });

        jButton7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/vere.jpg"))); // NOI18N
        jButton7.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButton7MousePressed(evt);
            }
        });

        jButton8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/winners3-5.jpg"))); // NOI18N
        jButton8.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButton8MousePressed(evt);
            }
        });
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });

        jLabel1.setText("DESARROLLADORES SAECE V 1.0");

        jButton9.setText("Regresar");
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton9ActionPerformed(evt);
            }
        });

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/la-gente-de-negocios-de-usuario-icono-4645-48.png"))); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addComponent(jButton9))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(32, 32, 32)
                                .addComponent(jLabel2)))))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(38, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel1)
                .addGap(228, 228, 228))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(17, 17, 17)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jButton9))
                            .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MousePressed
        JOptionPane.showMessageDialog(null, "ANTONIO ALEJANDRO MORENO MARTINEZ\n"
                + ""
                + "Nacido en la ciudad de Hermosillo, Sonora, Mexico\n Estudiante de la carreda de ING. en informatica");
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton1MousePressed

    private void jButton2MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MousePressed
        JOptionPane.showMessageDialog(null, "DAMARIS KAREN MORENO RAMIREZ\n"
                + ""
                + "Nacida en la ciudad de Hermosillo, Sonora, Mexico\n Estudiante de la carreda de ING. en informatica");
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton2MousePressed

    private void jButton8MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton8MousePressed
        JOptionPane.showMessageDialog(null, "LUIS CARLOS PIRI RAMOS\n"
                + ""
                + "Nacido en la ciudad de Hermosillo, Sonora, Mexico\n Estudiante de la carreda de ING. en informatica");
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton8MousePressed

    private void jButton5MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton5MousePressed
        JOptionPane.showMessageDialog(null, "JESUS FRANCISCO HERNANDEZ MURILLO\n"
                + ""
                + "Nacido en la ciudad de Hermosillo, Sonora, Mexico\n Estudiante de la carreda de ING. en informatica");
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton5MousePressed

    private void jButton6MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton6MousePressed
        JOptionPane.showMessageDialog(null, "JORGE ISAAC ENRIQUEZ JIMENEZ\n"
                + ""
                + "Nacido en la ciudad de Hermosillo, Sonora, Mexico\n Estudiante de la carreda de ING. en informatica");
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton6MousePressed

    private void jButton3MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MousePressed
        JOptionPane.showMessageDialog(null, "DANIEL SAID MORAGA VALENZUELA\n"
                + ""
                + "Nacido en la ciudad de Hermosillo, Sonora, Mexico\n Estudiante de la carreda de ING. en informatica");
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton3MousePressed

    private void jButton7MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton7MousePressed
        JOptionPane.showMessageDialog(null, "VERENICE YEDITH SALAZAR VALENZUELA\n"
                + ""
                + "Nacida en la ciudad de Hermosillo, Sonora, Mexico\n Estudiante de la carreda de ING. en informatica");
// TODO add your handling code here:
    }//GEN-LAST:event_jButton7MousePressed

    private void jButton4MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton4MousePressed
        JOptionPane.showMessageDialog(null, "FABIOLA GONZALEZ MOGHEN\n"
                + ""
                + "Nacida en la ciudad de Hermosillo, Sonora, Mexico\n Estudiante de la carreda de ING. en informatica");
// TODO add your handling code here:
    }//GEN-LAST:event_jButton4MousePressed

    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
        validando();
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton9ActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton8ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(desarrolladores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(desarrolladores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(desarrolladores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(desarrolladores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new desarrolladores().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    // End of variables declaration//GEN-END:variables

   public void validando() {
        String EXP = log.expedientes.getText();
        String pwd = log.claves_sesion2.getText();
        if (expedientes.getText().length() != 0 && claves_sesion2.getText().length() != 0) {
            try {

                BufferedReader alumnos = new BufferedReader(new FileReader("src/ArchivosTXT/Alumnos.txt"));
                String Materias;
                while ((Materias = alumnos.readLine()) != null) {

                    if (Materias.startsWith(EXP)) {
                        String[] Al = Materias.split(";");
                        if (Al[0].equals(EXP) && Al[22].equals(pwd)) {
                            
                            new inicio().setVisible(true);
                            this.setVisible(false);
                            inicio.constancia_inicio.setVisible(false);
                            inicio.reporte1.setVisible(false);
                            inicio.reporte2.setVisible(true);
                            inicio.reporte3.setVisible(false);
                            inicio.kardex_inicio.setVisible(true);
                            inicio.jMenu2.setVisible(false);
                        } else {
                            JOptionPane.showMessageDialog(null, "Datos Erroneos");
                        }
                    }
                }

                BufferedReader maestros = new BufferedReader(new FileReader("src/ArchivosTXT/Maestros.txt"));
                String Maestros;
                while ((Maestros = maestros.readLine()) != null) {
                    if (Maestros.startsWith(EXP)) {
                        String[] Ma = Maestros.split(";");
                        if (Ma[0].equals(EXP) && Ma[12].equals(pwd)) {
                            
                            new inicio().setVisible(true);
                            this.setVisible(false);
                            inicio.constancia_inicio.setVisible(false);
                            inicio.reporte1.setVisible(false);
                            inicio.reporte2.setVisible(true);
                            inicio.reporte3.setVisible(false);
                            inicio.kardex_inicio.setVisible(false);
                            inicio.jMenu2.setVisible(true);
                            inicio.alumno_inicio.setVisible(false);
                            inicio.maestro_inicio.setVisible(false);
                            inicio.materia_inicio.setVisible(false);
                            inicio.Calificaciones.setVisible(true);
                            inicio.jMenuItem6.setVisible(false);
                            //inicio.jMenuItem7.setVisible(false);

                        } else {
                            JOptionPane.showMessageDialog(null, "Datos Erroneos");
                        }
                    }
                }
                if (EXP.equals("Admin") && pwd.equals("Citrus")) {
                    
                    new inicio().setVisible(true);
                    this.setVisible(false);
                    constancia_inicio.setVisible(true);
                    inicio.reporte1.setVisible(true);
                    inicio.reporte2.setVisible(true);
                    inicio.reporte3.setVisible(true);
                    inicio.kardex_inicio.setVisible(true);
                    inicio.jMenu2.setVisible(true);
                    inicio.alumno_inicio.setVisible(true);
                    inicio.maestro_inicio.setVisible(true);
                    inicio.materia_inicio.setVisible(true);
                    inicio.Calificaciones.setVisible(true);
                    inicio.jMenuItem4.setVisible(true);
                    inicio.jMenuItem6.setVisible(true);
                    inicio.jMenuItem7.setVisible(true);
                } else {
                    JOptionPane.showMessageDialog(null, "Datos Erroneos");
                }
            } catch (IOException x) {
            }
        } else {
            JOptionPane.showMessageDialog(null, "Campos Requeridos");
        }
}
}
